package com.hulk.dryad.manage.config;



import com.hulk.dryad.manage.mdc.interceptor.SpringMvcInterceptor;

import com.hulk.dryad.manage.xss.core.XssCleanInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


/**
 * @author hulk
 * Content :mdc
 */
@Configuration
public class MdcConfig implements WebMvcConfigurer {


    @Bean
    public SpringMvcInterceptor springMvcInterceptor() {
        return new SpringMvcInterceptor();
    }

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		SpringMvcInterceptor interceptor = new SpringMvcInterceptor();
		registry.addInterceptor(interceptor).addPathPatterns("/**").excludePathPatterns("/rest/heartbeat","/favicon.ico").order(Ordered.LOWEST_PRECEDENCE);;
	}
}
